<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var str = 'userName=tom&password=123456&email=test123'
        var splitArr = str.split('&')
        var obj = {}
        for(var i = 0; i < splitArr.length; i++){
            console.log(splitArr[i].split('='))
            var childArr = splitArr[i].split('=')
            obj[childArr[0]] = childArr[1]
        }
        console.log(obj)
        console.log(splitArr)
    </script>

    <script>
        var str = "get-element-by-id"

        var splitArr = str.split('-')
        for(var i = 0; i < splitArr.length; i++){
            var start = splitArr[i].charAt(0)
            var end = splitArr[i].slice(1,splitArr[i].length)


            console.log(start.toLocaleLowerCase() + end)
            splitArr[i] = start.toLocaleLowerCase() + end
            //console.log(splitArr[i].charAt(0).toLocaleLowerCase())
        }
        var confirmStr = splitArr.join('')
        console.log(splitArr.join(''));
        console.log(confirmStr.charAt(0).toLocaleLowerCase() + confirmStr.slice(1,confirmStr))
    </script>
</body>
</html>